package com.lengchangjing.StructuralPatterns.ProxyPattern;

public class ProxySubject implements Subject {
    private Subject subject; //以真实角色作为代理角色的属性

    public ProxySubject(Subject subject) {
        this.subject = subject;
    }
    @Override
    public void request() {
        System.out.println("调用Subject之前的处理");
        subject.request(); //此处执行真实对象的request方法
        System.out.println("调用Subject之后的处理");

    }
}
